//创建类
class Ninja {
    constructor(name, level) {
        this.name = name;
        this.level = level;
    }
    swingSword() {
        return true;
    }
    //静态方法
    static compare(ninja1, ninja2) {
        return ninja1.level - ninja2.level;
    }
}

// 继承
class Person extends Ninja {
    constructor(name, level, weapon){
        super(name, level);
        this.weapon = weapon;
        
    }
    weildWeapon() {
        return true;
    }
}
var ninja = new Ninja("Yoshi");
var person1 = new Person("guojing", 1, "18zhang");
console.log(person1.swingSword())
console.log(person1.weildWeapon())